package com.winning.ds.common.util;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName : AppContext
 * @Description : 全局缓存 -- 单态模式
 * @Author : zhanglei
 * @Date : 2019/3/8 13:14
 **/
public class AppContext {

    //引导错误路径的地址
    public String toErrorPage = "";

    //首页地址
    public String toIndexPage = "";

    //登录界面地址
    public String loginPage = "";

    //登出界面地址
    public String loginOutPage = "";

    //服务器基础路径
    public String baseHostPath = "http://localhost:8080";

    //保存登录在线的
    public Map<String, String> loginUserMap = Collections.synchronizedMap(new HashMap());

    private static AppContext instance = null;

    private AppContext()
    {

    }

    public static AppContext getInstance()
    {
        if(null == instance)
        {
            instance = new AppContext();
        }

        return instance;
    }

    public Map<String, String> getLoginUserMap() {
        return loginUserMap;
    }

    public void setLoginUserMap(Map<String, String> loginUserMap) {
        this.loginUserMap = loginUserMap;
    }

}
